<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>BOM | 个人笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/js/DOM关于元素的获取.html" />
    
    
    <link rel="prev" href="../../md/js/对象的创建.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.19"
        data-chapter-title="BOM"
        data-filepath="md/js/BOM.md"
        data-basepath="../.."
        data-revision="Mon Sep 03 2018 20:26:06 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/html/html介绍.html">
            
                
                    <a href="../../md/html/html介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/html/html常用标签.html">
            
                
                    <a href="../../md/html/html常用标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        html常用标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/html/a标签的使用.html">
            
                
                    <a href="../../md/html/a标签的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        a标签的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="md/html/表格的介绍.html">
            
                
                    <a href="../../md/html/表格的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        表格的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="md/html/列表.html">
            
                
                    <a href="../../md/html/列表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="md/html/iframe内嵌框架.html">
            
                
                    <a href="../../md/html/iframe内嵌框架.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        iframe内嵌框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="md/html/表单.html">
            
                
                    <a href="../../md/html/表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="md/html/媒体标签.html">
            
                
                    <a href="../../md/html/媒体标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        媒体标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="md/html/下拉框，多行文本域以及对齐方式.html">
            
                
                    <a href="../../md/html/下拉框，多行文本域以及对齐方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        清除样式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/css/css引入方式.html">
            
                
                    <a href="../../md/css/css引入方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css引入方式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/css/css选择符与选择器.html">
            
                
                    <a href="../../md/css/css选择符与选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css选择符与选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/css/css字体样式.html">
            
                
                    <a href="../../md/css/css字体样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        css字体样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/css/图片的调整.html">
            
                
                    <a href="../../md/css/图片的调整.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        图片的调整
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/css/伪类选择.html">
            
                
                    <a href="../../md/css/伪类选择.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        伪类选择
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/css/盒子模型.html">
            
                
                    <a href="../../md/css/盒子模型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/css/浮动.html">
            
                
                    <a href="../../md/css/浮动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/css/定位.html">
            
                
                    <a href="../../md/css/定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/css/阴影.html">
            
                
                    <a href="../../md/css/阴影.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        阴影
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="md/css/图片溢出处理.html">
            
                
                    <a href="../../md/css/图片溢出处理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        图片溢出处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="md/css/动画.html">
            
                
                    <a href="../../md/css/动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="md/css/动画插件.html">
            
                
                    <a href="../../md/css/动画插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        动画插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="md/css/旋转菜单.html">
            
                
                    <a href="../../md/css/旋转菜单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        旋转菜单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="md/css/视口.html">
            
                
                    <a href="../../md/css/视口.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        移动端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="md/css/rem布局.html">
            
                
                    <a href="../../md/css/rem布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        rem布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="md/css/权重与雪碧图.html">
            
                
                    <a href="../../md/css/权重与雪碧图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        权重问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="md/css/移动底部菜单被系统键盘顶起问题.html">
            
                
                    <a href="../../md/css/移动底部菜单被系统键盘顶起问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        移动端导航问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="md/css/flex布局.html">
            
                
                    <a href="../../md/css/flex布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        flex布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.18" data-path="md/css/fullpage的使用.html">
            
                
                    <a href="../../md/css/fullpage的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.18.</b>
                        
                        fullpage
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.19" data-path="md/css/bootstrap.html">
            
                
                    <a href="../../md/css/bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.19.</b>
                        
                        bootstrap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.20" data-path="md/css/媒体查询.html">
            
                
                    <a href="../../md/css/媒体查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.20.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="md/js/js的介绍.html">
            
                
                    <a href="../../md/js/js的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        JavaScript的介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/js/JavaScript数据类型.html">
            
                
                    <a href="../../md/js/JavaScript数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        JavaScript数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/js/数据类型的转换.html">
            
                
                    <a href="../../md/js/数据类型的转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        数据类型的转换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="md/js/运算符.html">
            
                
                    <a href="../../md/js/运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="md/js/比较运算符.html">
            
                
                    <a href="../../md/js/比较运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        比较运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="md/js/赋值运算符.html">
            
                
                    <a href="../../md/js/赋值运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        赋值运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="md/js/逻辑操作符.html">
            
                
                    <a href="../../md/js/逻辑操作符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        逻辑操作符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="md/js/条件语句.html">
            
                
                    <a href="../../md/js/条件语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        条件语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="md/js/条件运算符.html">
            
                
                    <a href="../../md/js/条件运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        条件运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="md/js/位运算符.html">
            
                
                    <a href="../../md/js/位运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        位运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="md/js/循环语句.html">
            
                
                    <a href="../../md/js/循环语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        循环语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="md/js/for循环.html">
            
                
                    <a href="../../md/js/for循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        for循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="md/js/ES6.html">
            
                
                    <a href="../../md/js/ES6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.12.</b>
                        
                        ES6
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="md/js/内置对象.html">
            
                
                    <a href="../../md/js/内置对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.13.</b>
                        
                        内置对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.14" data-path="md/js/Array对象.html">
            
                
                    <a href="../../md/js/Array对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.14.</b>
                        
                        Array对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.15" data-path="md/js/Date对象.html">
            
                
                    <a href="../../md/js/Date对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.15.</b>
                        
                        Date对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.16" data-path="md/js/布尔值对象.html">
            
                
                    <a href="../../md/js/布尔值对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.16.</b>
                        
                        布尔值对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.17" data-path="md/js/数学对象.html">
            
                
                    <a href="../../md/js/数学对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.17.</b>
                        
                        数学对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.18" data-path="md/js/对象的创建.html">
            
                
                    <a href="../../md/js/对象的创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.18.</b>
                        
                        对象的创建
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.19" data-path="md/js/BOM.html">
            
                
                    <a href="../../md/js/BOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.19.</b>
                        
                        BOM
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.20" data-path="md/js/DOM关于元素的获取.html">
            
                
                    <a href="../../md/js/DOM关于元素的获取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.20.</b>
                        
                        DOM关于元素的获取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.21" data-path="md/js/DOM元素对象.html">
            
                
                    <a href="../../md/js/DOM元素对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.21.</b>
                        
                        DOM元素对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.22" data-path="md/js/DOM事件练习.html">
            
                
                    <a href="../../md/js/DOM事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.22.</b>
                        
                        DOM事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.23" data-path="md/js/DOM鼠标事件.html">
            
                
                    <a href="../../md/js/DOM鼠标事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.23.</b>
                        
                        DOM鼠标事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.24" data-path="md/js/事件代理.html">
            
                
                    <a href="../../md/js/事件代理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.24.</b>
                        
                        事件代理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.25" data-path="md/js/移动端事件.html">
            
                
                    <a href="../../md/js/移动端事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.25.</b>
                        
                        移动端事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.26" data-path="md/js/无缝轮播图.html">
            
                
                    <a href="../../md/js/无缝轮播图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.26.</b>
                        
                        无缝轮播图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.27" data-path="md/js/鼠标事件练习.html">
            
                
                    <a href="../../md/js/鼠标事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.27.</b>
                        
                        鼠标事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.28" data-path="md/js/ajax.html">
            
                
                    <a href="../../md/js/ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.28.</b>
                        
                        ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.29" data-path="md/js/高德地图的使用.html">
            
                
                    <a href="../../md/js/高德地图的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.29.</b>
                        
                        高德地图的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.30" data-path="md/js/预加载插件使用.html">
            
                
                    <a href="../../md/js/预加载插件使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.30.</b>
                        
                        预加载插件使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="md/jQuery/JQ变量的声明.html">
            
                
                    <a href="../../md/jQuery/JQ变量的声明.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        JQ变量的声明
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="md/jQuery/选择器和效果.html">
            
                
                    <a href="../../md/jQuery/选择器和效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        选择器和效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="md/jQuery/属性.html">
            
                
                    <a href="../../md/jQuery/属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="md/jQuery/尺寸.html">
            
                
                    <a href="../../md/jQuery/尺寸.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        尺寸
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="md/jQuery/遍历.html">
            
                
                    <a href="../../md/jQuery/遍历.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        遍历
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="md/jQuery/正则表达式.html">
            
                
                    <a href="../../md/jQuery/正则表达式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        正则表达式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="md/jQuery/jQuery事件练习.html">
            
                
                    <a href="../../md/jQuery/jQuery事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        jQuery事件练习
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="gitbook的安装.html">
            
                
                    <a href="../../gitbook的安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        gitbook的安装
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >个人笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <p>BOM(borwser object model&#x7684;&#x7B80;&#x5199;)&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;</p>
<p>&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E9B;&#x65B9;&#x6CD5;&#x4F7F;&#x5F97;&#x6211;&#x4EEC;&#x80FD;&#x591F;&#x64CD;&#x4F5C;&#x6D4F;&#x89C8;&#x5668;&#x6216;&#x8005;&#x83B7;&#x5F97;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x4FE1;&#x606F;&#xFF0C;&#x6BD4;&#x5982;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x5927;&#x5C0F;&#x3002;</p>
<h1 id="1&#x3001;window&#x5BF9;&#x8C61;">1&#x3001;window&#x5BF9;&#x8C61;</h1>
<p>&#x4E00;&#x4E2A;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x7A97;&#x53E3;&#x5C31;&#x4EE3;&#x8868;&#x4E00;&#x4E2A;window&#x5BF9;&#x8C61;&#xFF0C;&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x4E2D;&#x5D4C;&#x5957;&#x6709;&#x6846;&#x67B6;&#xFF0C;&#x8BE5;&#x6846;&#x67B6;&#x4E5F;&#x6709;&#x81EA;&#x5DF1;&#x7684;window&#x5BF9;&#x8C61;</p>
<p>&#x6240;&#x6709;JavaScript&#x7684;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x6216;&#x8005;&#x51FD;&#x6570;&#x90FD;&#x4F1A;&#x81EA;&#x52A8;&#x6210;&#x4E3A;window&#x5BF9;&#x8C61;&#x4E0B;&#x7684;&#x5C5E;&#x6027;&#x6216;&#x65B9;&#x6CD5;</p>
<p>&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x6210;&#x4E3A;window&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;</p>
<p>&#x5168;&#x5C40;&#x51FD;&#x6570;&#x6210;&#x4E3A;window&#x5BF9;&#x8C61;&#x7684;&#x65B9;&#x6CD5;</p>
<p>document(HTML&#x6587;&#x6863;)&#x4E5F;&#x662F;window&#x4E0B;&#x7684;&#x4E00;&#x4E2A;&#x5C5E;&#x6027;</p>
<p> window&#x5BF9;&#x8C61;&#x4E0B;&#x7684;&#x65B9;&#x6CD5;&#x6216;&#x5C5E;&#x6027;&#xFF0C;&#x5927;&#x90E8;&#x5206;&#x53EF;&#x4EE5;&#x5FFD;&#x7565;window&#x524D;&#x7F00;</p>
<pre><code>&#x4E0B;&#x9762;&#x4E24;&#x884C;&#x4EE3;&#x7801;&#x6548;&#x679C;&#x76F8;&#x540C;
console.log(document.querySelector(&quot;.test&quot;));
console.log(window.document.querySelector(&quot;.test&quot;));
//&#x4E0B;&#x9762;&#x4E24;&#x884C;&#x4EE3;&#x7801;&#x6548;&#x679C;&#x76F8;&#x540C;
//alert(&quot;123&quot;);
//window.alert(&quot;123&quot;);
//var clo= window.confirm(&quot;&#x786E;&#x5B9A;&#x5173;&#x95ED;&#x9875;&#x9762;&#x5417;&#xFF1F;&quot;);
//window.prompt(&quot;&#x8BF7;&#x8F93;&#x5165;&#x7528;&#x6237;&#x540D;&quot;);
</code></pre><pre><code>window.close()&#x5173;&#x95ED;&#x6D4F;&#x89C8;&#x5668;&#x7A97;&#x53E3;
&#x6CE8;&#x610F;&#xFF1A;&#x5728;&#x706B;&#x72D0;&#x6D4F;&#x89C8;&#x5668;&#x4E0D;&#x517C;&#x5BB9;
</code></pre><p>if(clo){
window.close();
}</p>
<pre><code>
 window.open()&#x6253;&#x5F00;&#x65B0;&#x7684;&#x7A97;&#x53E3;

&#x9ED8;&#x8BA4;&#x662F;&#x5728;&#x65B0;&#x7A97;&#x53E3;&#x6253;&#x5F00;

&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x591A;&#x4E2A;&#x53C2;&#x6570;

_self(&#x5F53;&#x524D;&#x7A97;&#x53E3;&#x6253;&#x5F00;)

&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x65B0;&#x7A97;&#x53E3;&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x524D;&#x63D0;&#x4E0D;&#x662F;&#x5728;&#x5F53;&#x524D;&#x7A97;&#x53E3;&#x8DF3;&#x8F6C;

 &#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x65B0;&#x7A97;&#x53E3;&#x7684;&#x540D;&#x5B57;&#x3002;
</code></pre><pre><code>    //window.open(&quot;http://www.baidu.com&quot;,&quot;_blank&quot;,&quot;width=300px,height=300px&quot;);
</code></pre><pre><code>&#x8BA1;&#x65F6;&#x5668;&#x4E5F;&#x662F;window&#x4E0B;&#x7684;&#x65B9;&#x6CD5;
</code></pre><p>window.setInterval();
window.setTimeout()</p>
<pre><code>
 moveBy(x,y);&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x65B0;&#x7A97;&#x53E3;&#x6253;&#x5F00;&#x7684;&#x4F4D;&#x7F6E;

scrollTo(x,y);&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x5185;&#x5BB9;&#x6EDA;&#x52A8;&#x4F4D;&#x7F6E;

scrollBy(x,y);&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x5185;&#x5BB9;&#x6EDA;&#x52A8;&#x4F4D;&#x7F6E;

&#x6CE8;&#x610F;&#xFF1A;&#x901A;&#x8FC7;&#x6DFB;&#x52A0;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&#x624D;&#x80FD;&#x89E6;&#x53D1;

scrollTo&#x548C;scrollBy&#x7684;&#x533A;&#x522B;

scrollTo&#x8DDF;&#x76F8;&#x5BF9;&#x6D4F;&#x89C8;&#x5668;&#x5B9A;&#x4E0D;&#x53BB;&#x7684;&#x4F4D;&#x7F6E;&#x8FDB;&#x884C;&#x79FB;&#x52A8;

scrollBy&#x662F;&#x6839;&#x636E;&#x6587;&#x6863;&#x7684;&#x539F;&#x6765;&#x4F4D;&#x7F6E;&#x8FDB;&#x884C;&#x4F4D;&#x79FB;&#x3002;
</code></pre><p>window.open(&quot;test.html&quot;,&quot;myPage&quot;,&quot;width=500px,height=300px&quot;);</p>
<pre><code>window.scrollBy(0,100);
</code></pre><pre><code>&lt;a href=&quot;3&#x3001;screen&#x5BF9;&#x8C61;.html&quot;&gt;screen&lt;/a&gt;
&lt;div class=&quot;test&quot; style=&quot;height:1000px;&quot;&gt;
&lt;div class=&quot;btn1&quot;&gt;&#x8FD4;&#x56DE;&#x4E0A;&#x4E00;&#x9875;&lt;/div&gt;
&lt;div class=&quot;btn&quot;style=&quot;margin-top: 200px;&quot;&gt;&#x6309;&#x94AE;&lt;/div&gt;
&lt;/div&gt;
</code></pre><pre><code>&#x83B7;&#x53D6;&#x5143;&#x7D20;
var btn=document.getElementsByClassName(&quot;btn&quot;)[0];
&#x6DFB;&#x52A0;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;
btn.addEventListener(&quot;click&quot;,function(){
window.scrollTo(0,200);
});
btn.addEventListener(&quot;click&quot;,function(){
window.scrollBy(0,200);
})
</code></pre><p> BOW&#x6CA1;&#x6709;&#x7EDF;&#x4E00;&#x6807;&#x51C6;&#xFF0C;&#x6240;&#x4EE5;&#x4EE5;&#x4E0B;&#x62FF;&#x5230;&#x7684;&#x6570;&#x636E;&#x5728;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x4E0A;&#x9762;&#x4F1A;&#x6709;&#x504F;&#x5DEE;</p>
<p>window&#x5BF9;&#x8C61;&#x5C5E;&#x6027;</p>
<p>innerWidth,innerHeight,&#x83B7;&#x53D6;&#x6D4F;&#x89C8;&#x5668;&#x7A97;&#x53E3;&#x7684;&#x5BBD;&#x9AD8;</p>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x8FD9;&#x91CC;&#x83B7;&#x53D6;&#x7684;&#x5BBD;&#x9AD8;&#xFF0C;&#x4E0D;&#x5305;&#x62EC;&#x5DE5;&#x5177;&#x680F;&#xFF0C;&#x8FD8;&#x6709;&#x5730;&#x5740;&#x680F;&#x3002;</p>
<p> &#x4F4E;&#x7248;&#x672C;&#x7684;IE&#x4E0D;&#x80FD;&#x591F;&#x517C;&#x5BB9;</p>
<pre><code>document.body.clientHeight &#x62FF;&#x5230;html&#x6587;&#x6863;&#x7684;&#x9AD8;&#x5EA6;
document.documentElement.clientHeight&#x62FF;&#x5230;&#x6D4F;&#x89C8;&#x5668;&#x7A97;&#x53E3;&#x7684;&#x9AD8;&#x5EA6;
document.write(window.innerWidth);
document.write(window.innerHeight);
//ie&#x4E2D;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4E0B;&#x9762;&#x65B9;&#x6CD5;&#x62FF;&#x5230;&#x6D4F;&#x89C8;&#x5668;&#x7A97;&#x53E3;&#x5927;&#x5C0F;
var w= document.body.clientWidth || document.documentElement.clientWidth;
var h= document.body.clientHeight || document.documentElement.clientHeight
console.log(&quot;w: &quot;+ w,&quot;h: &quot;+h);
function gatW(){
return window.innerWidth ||document.body.clientWidth || document.documentElement.clientWidth;
}
</code></pre><p> window.outerHeight&#x548C;window.outerWidth&#x83B7;&#x53D6;&#x5230;&#x6D4F;&#x89C8;&#x5668;&#x6574;&#x4E2A;&#x7A97;&#x53E3;&#x7684;&#x5927;&#x5C0F;&#x5305;&#x62EC;&#x5DE5;&#x5177;&#x680F;&#xFF0C;&#x6EDA;&#x52A8;&#x6761;&#x7B49;</p>
<pre><code>console.log(window.outerHeight);
console.log(window.outerWidth);
</code></pre><p> window.pageXOffset&#x548C;window.pageYOffset&#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x6587;&#x6863;&#x5411;&#x4E0B;&#x6EDA;&#x52A8;&#x7684;&#x8DDD;&#x79BB;(&#x5373;&#x6EDA;&#x52A8;&#x6761;&#x7684;&#x4F4D;&#x7F6E;)</p>
<pre><code>console.log(window.pageXOffset);
console.log(window.pageYOffset);
</code></pre><p>window.screenLeft&#x548C;window.screenTop&#x83B7;&#x53D6;&#x5230;&#x6D4F;&#x89C8;&#x5668;&#x5230;&#x5C4F;&#x5E55;&#x5DE6;&#x4E0A;&#x89D2;&#x7684;&#x8DDD;&#x79BB;&#xFF0C;&#x4E0D;&#x517C;&#x5BB9;&#x706B;&#x72D0;</p>
<p>&#x706B;&#x72D0;&#xFF1A;window.screenX&#x548C;window.screenY&#x6765;&#x83B7;&#x53D6;</p>
<pre><code>console.log(window.screenLeft);
console.log(window.screenTop);
</code></pre><p>&#x901A;&#x8FC7;&#x7C7B;&#x540D;&#x83B7;&#x53D6;&#x5143;&#x7D20;</p>
<pre><code>var btn1 =document.getElementsByClassName(&quot;btn1&quot;)[0];
btn1.addEventListener(&quot;click&quot;,function(){
history.back();
})
</code></pre><h1 id="navigator&#x5BF9;&#x8C61;">navigator&#x5BF9;&#x8C61;</h1>
<p>&#x7528;&#x6765;&#x83B7;&#x53D6;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x4FE1;&#x606F;</p>
<p>appCodeName:&#x6D4F;&#x89C8;&#x5668;&#x4EE3;&#x7801;&#x540D;</p>
<p>appName&#xFF1A;&#x6D4F;&#x89C8;&#x5668;&#x540D;&#x79F0;</p>
<p>appVersion&#xFF1A;&#x6D4F;&#x89C8;&#x5668;&#x7248;&#x672C;&#x53F7;</p>
<p>platform&#xFF1A;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x6D4F;&#x89C8;&#x5668;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x5E73;&#x53F0;</p>
<p>console.log(window.navigator);</p>
<h1 id="screen&#x5BF9;&#x8C61;">screen&#x5BF9;&#x8C61;</h1>
<p>availWidth&#x548C;availHeigth&#x5C4F;&#x5E55;&#x53EF;&#x7528;&#x533A;&#x57DF;&#x7684;&#x5BBD;&#x9AD8;(&#x4E0D;&#x5305;&#x62EC;&#x5DE5;&#x5177;&#x680F;)</p>
<p> width&#x548C;height&#x5C4F;&#x5E55;&#x7684;&#x5BBD;&#x9AD8;</p>
<pre><code>console.log(screen.availHeight);
console.log(screen.availWidth);
console.log(screen.width);
console.log(screen.height);
var btn=document.querySelector(&quot;.btn&quot;);
btn.addEventListener(&quot;click&quot;,function(){
history.go(-2);
})
</code></pre><h1 id="history&#x5BF9;&#x8C61;">history&#x5BF9;&#x8C61;</h1>
<p>&#x83B7;&#x53D6;&#x5386;&#x53F2;&#x8BB0;&#x5F55;</p>
<p> length:&#x83B7;&#x53D6;&#x5230;&#x5386;&#x53F2;&#x8BBF;&#x95EE;&#x9875;&#x9762;&#x7684;&#x4E2A;&#x6570;</p>
<p>( &#x5728;&#x4E00;&#x6761;&#x94FE;&#x4E0A;&#x8BBF;&#x95EE;&#x7684;&#x9875;&#x9762;&#x4E2A;&#x6570;)</p>
<p>back()&#xFF1B;&#x8FD4;&#x56DE;&#x4E0A;&#x4E00;&#x9875;</p>
<p>forward()&#xFF1B;&#x4E0B;&#x4E00;&#x9875;</p>
<p>go(url/num);&#x53EF;&#x7528;&#x8DF3;&#x8F6C;&#x5230;&#x5177;&#x4F53;&#x7684;&#x67D0;&#x4E2A;&#x9875;&#x9762;</p>
<p>-1:&#x4E0A;&#x4E00;&#x4E2A;&#x9875;&#x9762;</p>
<p>1&#xFF1A;&#x4E0B;&#x4E00;&#x4E2A;&#x9875;&#x9762;</p>
<pre><code>console.log(history.length);
//var btn=document.getElementsByClassName(&quot;btn&quot;)[0];
var btn=document.querySelector(&quot;.btn&quot;);
btn.addEventListener(&quot;click&quot;,function(){
history.forward();
})
</code></pre><p><a href="#to">&#x6D4B;&#x8BD5;&#x951A;&#x70B9;</a></p>
<p><div class="btn">&#x6309;&#x94AE;</div></p>
<pre><code>&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;username&quot;  value=&quot;1234&quot; /&gt;
&lt;input type=&quot;text&quot; name=&quot;pw&quot;value=&quot;12345697&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;&#x63D0;&#x4EA4;&quot;/&gt;
&lt;/form&gt;
</code></pre><pre><code>&lt;div id=&quot;sub&quot;&gt;
&#x83B7;&#x53D6;&#x5185;&#x5BB9;
&lt;/div&gt;
</code></pre><h1 id="location&#x5BF9;&#x8C61;">location&#x5BF9;&#x8C61;</h1>
<p>&#x7528;&#x6765;&#x83B7;&#x53D6;&#x5730;&#x5740;&#x680F;&#x4FE1;&#x606F;</p>
<p> &#x5C5E;&#x6027;(&#x53EF;&#x8BFB;&#x53EF;&#x5199;)</p>
<p> hash&#xFF1A;&#x83B7;&#x53D6;&#x951A;&#x70B9;&#x4FE1;&#x606F;</p>
<p> search&#xFF1A;&#x83B7;&#x53D6;&#xFF1F;&#x540E;&#x9762;&#x7684;&#x5185;&#x5BB9;</p>
<p> host:&#x83B7;&#x53D6;&#x4E3B;&#x673A;&#x540D;&#x548C;&#x7AEF;&#x53E3;&#x53F7;</p>
<p> hostname:&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x7684;&#x4E3B;&#x673A;&#x540D;</p>
<p> href:&#x8FD4;&#x56DE;&#x5B8C;&#x6574;&#x7684;URL&#x5730;&#x5740;</p>
<p> pathname:&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x9875;&#x9762;&#x7684;URL&#x8DEF;&#x52B2;&#x90E8;&#x5206;</p>
<p> port&#xFF1A;&#x7AEF;&#x53E3;&#x53F7;</p>
<p> protocol&#xFF1A;&#x8FD4;&#x56DE;&#x5F53;&#x524D;URL&#x7684;&#x534F;&#x8BAE;</p>
<pre><code>var btn=document.querySelector(&quot;.btn&quot;);
btn.addEventListener(&quot;click&quot;,function(){
console.log(location.hash);
})
var sub=document.getElementById(&quot;sub&quot;);
sub.addEventListener(&quot;click&quot;,function(){
console.log(location.search);
})
console.log(location.host);
console.log(location.hostname);
console.log(location.href);
//location.href=&quot;4&#x3001;History&#x5BF9;&#x8C61;.html&quot;;
console.log(location);
</code></pre><h1 id="cookie&#x5BF9;&#x8C61;">cookie&#x5BF9;&#x8C61;</h1>
<p>&#x7528;&#x6765;&#x5B58;&#x50A8;web&#x7AEF;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x7684;&#xFF0C;&#x4FE1;&#x606F;&#x662F;&#x76F4;&#x63A5;&#x5B58;&#x50A8;&#x5230;&#x7528;&#x6237;&#x7684;&#x786C;&#x76D8;&#x91CC;&#x9762;&#x7684;</p>
<p>&#x751F;&#x547D;&#x5468;&#x671F;&#xFF1A;</p>
<p> &#x6CA1;&#x6709;&#x8BBE;&#x7F6E;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x5173;&#x95ED;&#x5C31;&#x6E05;&#x9664;</p>
<p>&#x8BBE;&#x7F6E;&#x4E86;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#xFF0C;&#x5230;&#x8FBE;&#x8BBE;&#x7F6E;&#x7684;&#x65F6;&#x95F4;&#x540E;&#x5C31;&#x6E05;&#x9664;cookie</p>
<p>cookie&#x5B58;&#x50A8;&#x5927;&#x5C0F;&#x4E3A;4k</p>
<p>cname:&#x662F;&#x81EA;&#x5DF1;&#x8BBE;&#x7F6E;&#x7684;cookie&#x7684;&#x540D;&#x5B57;</p>
<p>cvalue&#xFF1A;&#x7528;&#x6237;&#x4F20;&#x5165;&#x7684;&#x503C;</p>
<p>exdays&#xFF1A;&#x8BBE;&#x7F6E;&#x7684;&#x8FC7;&#x671F;&#x65F6;&#x95F4;</p>
<p>&#x8BBE;&#x7F6E;cookie</p>
<pre><code>function setCookie(cname,cvalue,exdays){
var data =new Date();
data.setTime(data.getTime()+(exdays*24*60*60*1000));
console.log(data);
console.log(data.toGMTString());
//&#x8BA1;&#x7B97;&#x8FC7;&#x671F;&#x65F6;&#x95F4;
var expires=&quot;expires=&quot;+data.toGMTString();
//&#x8BBE;&#x7F6E;cookie
document.cookie=cname + &quot;=&quot;+ cvalue+&quot;;&quot;+expires;
}
//&#x83B7;&#x53D6;cookie&#x7684;&#x5185;&#x5BB9;
function getcookie(){
var username=document.cookie;
console.log(username);
var arr= username.split(&quot;=&quot;);
console.log(arr);
return arr[1];
}
//&#x68C0;&#x6D4B;&#x662F;&#x5426;&#x5DF2;&#x6709;cookie
function checkcookie(){
var data=getcookie();
if(data!=&quot;&quot; &amp;&amp; data!=null &amp;&amp; data!=&quot;null&quot;){
alert(&quot;&#x6B22;&#x8FCE;&quot;+data+&quot;&#x56DE;&#x6765;&#xFF01;&quot;);
}else{
var user=prompt(&quot;&#x8BF7;&#x8F93;&#x5165;&#x7528;&#x6237;&#x540D;&quot;);
setCookie(&quot;username&quot;,user,7);
}
}
checkcookie();
</code></pre><h1 id="html5&#x672C;&#x5730;&#x5B58;&#x50A8;">html5&#x672C;&#x5730;&#x5B58;&#x50A8;</h1>
<p>&#x7528;&#x4E8E;&#x672C;&#x5730;&#x5B58;&#x50A8;&#x7528;&#x6237;&#x6D4F;&#x89C8;&#x5668;&#x4FE1;&#x606F;</p>
<p> &#x53EF;&#x4EE5;&#x5B58;&#x50A8;&#x5927;&#x91CF;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x800C;&#x4E0D;&#x5F71;&#x54CD;&#x6027;&#x80FD;</p>
<p>&#x5B58;&#x50A8;&#x5927;&#x5C0F;&#x53EF;&#x8FBE;5M&#x3002;</p>
<p>localStorage&#xFF1A;&#x957F;&#x4E45;&#x4FDD;&#x5B58;&#x7F51;&#x7AD9;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x4FDD;&#x5B58;&#x6570;&#x636E;&#x6CA1;&#x6709;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#xFF0C;&#x76F4;&#x5230;&#x624B;&#x52A8;&#x6E05;&#x9664;</p>
<p> sessionStorage&#xFF1A;&#x4E34;&#x65F6;&#x4FDD;&#x5B58;&#x6570;&#x636E;&#xFF0C;&#x5F53;&#x6D4F;&#x89C8;&#x5668;&#x5173;&#x95ED;&#x6216;&#x8005;&#x7A97;&#x53E3;&#x5173;&#x95ED;&#x6570;&#x636E;&#x5C31;&#x4F1A;&#x88AB;&#x6E05;&#x9664;&#x6389;</p>
<p>&#x65B9;&#x6CD5;&#xFF1A;</p>
<p>setItem(key&#xFF0C;value)&#xFF1B;&#x952E;&#x540D;&#xFF1A;&#x952E;&#x503C;      &#x8BBE;&#x7F6E;&#x7F13;&#x5B58;</p>
<p>getItem(key)&#xFF1B;&#x83B7;&#x53D6;&#x7F13;&#x5B58;</p>
<p>siteName:&#x8BBE;&#x7F6E;&#x7F13;&#x5B58;&#xFF0C;&#x81EA;&#x5DF1;&#x5C31;&#x4EE3;&#x8868;&#x952E;&#x540D;&#x3002;</p>
<p>removeItem(key)&#xFF1B;&#x79FB;&#x9664;&#x7F13;&#x5B58;</p>
<p>clear();&#x6E05;&#x7A7A;&#x6240;&#x6709;&#x7F13;&#x5B58;</p>
<pre><code>localStorage.setItem(&quot;username&quot;,&quot;css&quot;);
localStorage.setItem(&quot;pw&quot;,&quot;1234&quot;);
localStorage.setItem(&quot;sex&quot;,&quot;nan&quot;);
console.log(localStorage.getItem(&quot;username&quot;));
localStorage.siteName=&quot;html&quot;;
localStorage.siteName=&quot;javaScript&quot;;
console.log(localStorage.siteName);
//console.log(localStorage.removeItem(&quot;username&quot;));
//console.log(localStorage.removeItem(&quot;siteName&quot;));
//    localStorage.clear();
console.log(localStorage.key(1));//
//&#x53EF;&#x4EE5;&#x901A;&#x8FC7;key()&#x65B9;&#x6CD5;&#x904D;&#x5386;&#x8F93;&#x51FA;&#x7F13;&#x5B58;&#x5185;&#x5BB9;
for (var i=0;i&lt;localStorage.length;i++) {
document.write(localStorage.key(i)+&quot;:&quot;+localStorage.getItem(localStorage.key(i)));
document.write(&quot;&lt;br /&gt;&quot;);
}
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/js/对象的创建.html" class="navigation navigation-prev " aria-label="Previous page: 对象的创建"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/js/DOM关于元素的获取.html" class="navigation navigation-next " aria-label="Next page: DOM关于元素的获取"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
